package pjkanri.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import pjkanri.dao.DAOException;
import pjkanri.entity.Issure_detail;
import pjkanri.service.Issure_DetailService;

/**
 * Servlet implementation class Issure_DetailServlet
 */
@WebServlet("/Issure_DetailServlet")
public class Issure_DetailServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		String description = request.getParameter("description");

		Issure_detail issure_detail = new Issure_detail(description);

		try {
			Issure_DetailService.insert(issure_detail);
		} catch (DAOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		String forwardPath = "issure_detail.jsp";

		// 転送処理
		request.getRequestDispatcher(forwardPath).forward(request, response);

	}

}
